home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / mac / Resources / g⁄matter / g⁄matter catalog / CREDITS.Dxr / 00015_paddleKeyDown.ls < prev    next >
Encoding:
Text File  |  1996-03-10  |  1.4 KB  |  57 lines

  1. on paddleKeyDown
  2.   global giPongEasyMode, giPlayFieldBottomBoundary, giPongStraightThru, gbPongWaves, glBulletsInPlay, giPongPaddleChannel, giPaddleHalfWidth
  3.   set lsValidKeys to "1,2,3,4,5,6,7,8,9"
  4.   if lsValidKeys contains the key then
  5.     pongPaddleLevel(integer(the key))
  6.   end if
  7.   if the key = "f" then
  8.     set liCount to count(glBulletsInPlay)
  9.     if liCount < 7 then
  10.       set liChan to liCount + 15
  11.       set liH to the locH of sprite giPongPaddleChannel + giPaddleHalfWidth
  12.       set liV to the locV of sprite giPongPaddleChannel - 10
  13.       set liPos to liCount + 1
  14.       addAt(glBulletsInPlay, 1, birth(script "bulletScript", liH, liV, 5, liChan, "Bullet", liPos))
  15.     end if
  16.   end if
  17.   if the key = "e" then
  18.     set giPongEasyMode to 1
  19.     beep(3)
  20.   end if
  21.   if the key = "h" then
  22.     set giPongEasyMode to 0
  23.     beep(2)
  24.   end if
  25.   if the key = "s" then
  26.     pongStraightThruToggle()
  27.   end if
  28.   if the key = "w" then
  29.     pongWaveToggle()
  30.   end if
  31.   if the key = "r" then
  32.     pongPaddleChange(random(5))
  33.   end if
  34.   if (the key = "q") or (the key = "Q") then
  35.     cursor(0)
  36.     forget(the activeWindow)
  37.   end if
  38. end
  39.  
  40. on pongWaveToggle
  41.   global gbPongWaves
  42.   if gbPongWaves then
  43.     set gbPongWaves to 0
  44.   else
  45.     set gbPongWaves to 1
  46.   end if
  47. end
  48.  
  49. on pongStraightThruToggle
  50.   global giPongStraightThru
  51.   if giPongStraightThru then
  52.     set giPongStraightThru to 0
  53.   else
  54.     set giPongStraightThru to 1
  55.   end if
  56. end
  57.